#include<sys/stat.h>
#include<sys/types.h>
#include<unistd.h>
#include<stdio.h>
#include<fcntl.h>
#include<string.h>
int main()
{
	//首先是库函数:printf,fprintf...
	fprintf(stdout,"hello fprintf");
	printf("hello printf");
	//fflush(stdout);
	//之后是系统调用函数
	const char* msg="hello write\n";
	write(1,msg,strlen(msg));
	close(1);
	//close(1);
	//fork();
	return 0;
}
//int main()
//{
////	int fd=open("log.txt",O_CREAT|O_WRONLY|O_TRUNC,0666);
////	if(fd<0)
////	{
////		perror("open");
////		exit(1);
////	}
////	close(1);
////	dup2(fd,1);
//	printf("hello open\n");
//	printf("hello open\n");
//	printf("hello open\n");
//	printf("hello open\n");
//	printf("hello open\n");
//	return 0;
//}
